﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LGSVR.Common;
using System.Data.SqlClient;
using System.Data;

namespace LGSVR.BLL.Terminal
{
    public class ConfigInfoBLL
    {
        public bool IsHasConfigID(string configID, string oginalConfigID)
        {
            string sql = "select count(*) from configInfo where [configID]=@configID";
            if (oginalConfigID.Trim() != "")
            {
                sql += " and configID!=@oginalConfigID";
            }
            List<SqlParameter> lstParam = new List<SqlParameter>();
            lstParam.Add(new SqlParameter("@configID", configID.Trim()));
            lstParam.Add(new SqlParameter("@oginalConfigID", oginalConfigID.Trim()));

            int len = Convert.ToInt32(SQLHelper.GetScale(sql, System.Data.CommandType.Text, lstParam.ToArray()));
            return len > 0;
        }

    }
}
